/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rainful.servlet;

import com.caucho.hessian.server.HessianServlet;
import java.util.logging.Level;
import java.util.logging.Logger;
import rainful.AbortException;
import rainful.echo.Echo;
import rainful.TalkAction;
import rainful.TalkAgent;
import rainful.echo.ErrorEcho;

/**
 *
 * @author Administrator
 */
public class TalkCloud extends HessianServlet implements TalkAction {


    public Echo ask(Echo echo) {
        try {
            return new TalkAgent().listen(echo);
        } catch (AbortException ex) {
            Logger.getLogger(TalkCloud.class.getName()).log(Level.SEVERE, null, ex);
            return echo.error();
        }
    }

}
